﻿using ImoviesBlazor.Shared.Entities;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace ImoviesBlazor.Server.Repository
{
    public interface IAnimationRepository
    {
        /// <summary>
        /// 获取全部数据
        /// </summary>
        /// <returns></returns>
        Task<IEnumerable<Animation>> GetAllListAsync();

        /// <summary>
        /// 分页获取数据
        /// </summary>
        /// <param name="pageSize"></param>
        /// <param name="pageNum"></param>
        /// <returns></returns>
        Task<IEnumerable<Animation>> GetListAsync(int pageSize, int pageNum);

        /// <summary>
        /// 获取视频播放链接
        /// </summary>
        /// <param name="vid">视频id</param>
        /// <returns></returns>
        Task<IEnumerable<AnimationVlink>> GetVlinkList(string vid);

        /// <summary>
        /// 获取所有年份
        /// </summary>
        /// <returns></returns>
        Task<IEnumerable<uint>> GetAllYearsAsync();

        /// <summary>
        /// 获取总记录数
        /// </summary>
        /// <returns></returns>
        Task<int> GetTotal();

        /// <summary>
        /// 添加动漫
        /// </summary>
        /// <param name="animation"></param>
        void AddAnimation(Animation animation);

        /// <summary>
        /// 修改动漫
        /// </summary>
        /// <param name="animation"></param>
        void UpdateAnimation(Animation animation);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="animationId"></param>
        Task DeleteAnimation(string animationId);

        /// <summary>
        /// 保存操作
        /// </summary>
        /// <returns></returns>
        Task<bool> SaveAsync();

    }
}
